*{账户信息导航栏}*
<div id="accountnav">
	<div class="left-wrap">
		<p id="account-info">
		#{if session.username}
			您好，欢迎 <span class="important_1">${session.username}</span> 光临。
		#{/if}
		#{else}
			您好，欢迎光临！ 
			<a href="/login"class="important_1">请登录</a> 或 <a href="/register" class="important_1">免费注册</a> </p>
		#{/else}
	</div>
	<div class="right-wrap">
		<ul>
			#{if session.username}
			<div class="messageBlock" style="display:none;"><a href="/users/message" >新消息(<font class="important_1 messageCount">0</font>)条</a></div>
			&nbsp;&nbsp;&nbsp;
			<a href="/logout" class="important_1">退出登录</a>
			#{/if}
		</ul>		
	</div>
</div>

<script language="javascript">
var newMessageCountId;
$(function(){
	$("#searchTabs li").click(function(){
		$("#searchTabs li").removeClass("active");
		$(this).addClass("active");
		$("#search-type").val($(this).attr("type"));
		$("#search-form").attr('action', $(this).attr("action"));
	});
	#{if session.username}
	countNewMessages();
	newMessageCountId = setInterval(countNewMessages, 15000);
	#{/if}
});
function countNewMessages() {
	$.ajax({
		url: "@{UserMessage.countNewMessage()}",
		type: "GET",
		dataType: "json",
		complete: function(XMLHttpRequest, textStatus, errorThrown) {
			if(textStatus == "error") {
				var errJson = eval("("+XMLHttpRequest.responseText+")");
				var errMsg = "回复失败，"+errJson.message;
				clearInterval(newMessageCountId);
				//$("#errMsg").html(errMsg);
				//alert(errMsg);
			} else {
				var count = XMLHttpRequest.responseText;
				if(count && $.trim(count).length > 0 && count!=0) {
					$(".messageBlock").css("display", "inline");
					$(".messageCount").html(count);
				} else if(count == 0 || count == "0") {
					$(".messageBlock").css("display", "none");
					$(".messageCount").html(count);
				}
			}
		}
	});
}

</script>

<div class="shead center clear">
	<div class="logo"><a href="/"><img src="/public/images/logo.gif"></a></div>
	<form id="search-form" class="search">*{搜索框}*
		<ul id="searchTabs" class="searchTabs">
			<li class="active" action="@{Application.search}">全站</li>
			<li action="@{Commodities.index}">商品</li>
			<li action="@{Brands.index}">品牌</li>
		</ul>
		<div class="search-field">
			<input type="text" name="_search"/>
		</div>
		<button class="search-submit">搜索</button>
	</form>
</div>

*{导航栏}*
<div class="categorynav">
	<ul class="center">
		<li id="index_item" class="active"><a href="/">首页</a></li>
		<li id="brands_item"><a href="@{Brands.index}">品牌专区</a></li>
		<li id="commodity_item"><a href="@{Commodities.index}">商品列表</a></li>
		<li id="article_item"><a href="@{Articles.index}">文章列表</a></li>
		<li id="news_item"><a href="#">消息列表</a></li>
		<li id="transPrice_item"><a href="@{TransPrice.publicindex()}">运价查询</a></li>
		<li id="message_item"><a href="/messageboard/index">在线咨询</a></li>
		#{if session.username}
		<li id="user_item"><a href="@{Users.index}">用户中心</a></li>
		<li id="shoppingCar_item"><a href="/shoppingCars/shoppingCar">购物车</a></li>
		#{/if}
	</ul>
</div>